package com.sunda.spmswms.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.sunda.spmswms.entity.WhsMoveDtl;
import com.sunda.spmswms.mapper.WhsMoveDtlMapper;
import com.sunda.spmswms.service.IWhsMoveDtlService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 移仓任务明细 服务实现类
 * </p>
 *
 * @author Wayne
 * @since 2021-05-31
 */
@Service
public class WhsMoveDtlServiceImpl extends ServiceImpl<WhsMoveDtlMapper, WhsMoveDtl> implements IWhsMoveDtlService {

    @Override
    public int addWhsMoveDtl(WhsMoveDtl whsMoveDtl) {
        return this.baseMapper.insert(whsMoveDtl);
    }

    @Override
    public WhsMoveDtl getByAutoId(int autoId) {
        return this.baseMapper.selectOne(new QueryWrapper<WhsMoveDtl>().eq("AUTO_ID", autoId));
    }

    @Override
    public int updateWhsMoveDtl(WhsMoveDtl whsMoveDtl) {
        return this.baseMapper.update(whsMoveDtl, new QueryWrapper<WhsMoveDtl>().eq("AUTO_ID", whsMoveDtl.getAutoId()));
    }
}
